import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../views/LoginView.vue'
import RegisterView from '../views/RegisterView.vue'
import AppointmentView from '../views/AppointmentView.vue'
import IndexView from '../views/IndexView.vue'
import PersonalView from '../views/PersonalView.vue'
import HospitalView from '@/views/HospitalView.vue'
import AppointmentcancelView from '@/views/AppointmentcancelView.vue'
import AppointmentlistView from '@/views/AppointmentlistView.vue'
import AppointmentsuccessView from '@/views/AppointmentsuccessView.vue'
import ConfirmorderView from '@/views/ConfirmorderView.vue'
import ReportView from '@/views/ReportView.vue'
import ReportlistView from '@/views/ReportlistView.vue'
import SetmealView from '@/views/SetmealView.vue'
import SelectdateView from '@/views/SelectdateView.vue'
import NotfoundView from '@/views/NotfoundView.vue'
import ShopView from '@/views/ShopView.vue'
import SearchView from '@/views/SearchView.vue'
import ShoplistView from '@/views/ShoplistView.vue'
import ShopcancelView from '@/views/ShopcancelView.vue'
import ChatView from '@/views/ChatView.vue'
import ForgetView from '@/views/ForgetView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: LoginView,
    },
    {
      path: '/register',
      name: 'register',
      component: RegisterView,
    },
    {
      path: '/appointment',
      name: 'appointment',
      component: AppointmentView,
    },
    {
      path: '/index',
      name: 'index',
      component: IndexView,
    },
    {
      path: '/personal',
      name: 'personal',
      component: PersonalView,
    },
    {
      path: '/hospital',
      name: 'hospital',
      component: HospitalView,
    },
    {
      path: '/appointmentcancel',
      name: 'appointmentcancel',
      component: AppointmentcancelView,
    },
    {
      path: '/appointmentlist',
      name: 'appointmentlist',
      component: AppointmentlistView,
    },
    {
      path: '/appointmentsuccess',
      name: 'appointmentsuccess',
      component: AppointmentsuccessView,
    },
    {
      path: '/confirmorder',
      name: 'confirmorder',
      component: ConfirmorderView,
    },
    {
      path: '/report',
      name: 'report',
      component: ReportView,
    },
    {
      path: '/reportlist',
      name: 'reportlist',
      component: ReportlistView,
    },
    {
      path: '/setmeal',
      name: 'setmeal',
      component: SetmealView,
    },
    {
      path: '/selectdate',
      name: 'selectdate',
      component: SelectdateView,
    },
    {
      path: '/shop',
      name: 'shop',
      component: ShopView,
    },
    {
      path: '/search',
      name: 'search',
      component: SearchView,
    },
    {
      path: '/shoplist',
      name: 'shoplist',
      component: ShoplistView,
    },
    {
      path: '/shopcancel',
      name: 'shopcancel',
      component: ShopcancelView,
    },
    {
      path: '/chat',
      name: 'chat',
      component: ChatView,
    },
    {
      path: '/forget',
      name: 'forget',
      component: ForgetView,
    },

    //通配符处理错误路由
    {
      path: '/:pathMatch(.*)*',
      name: 'notfound',
      component: NotfoundView,
    },
  ],
})

export default router
